package com.ccc.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Research entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "research")
public class Research implements java.io.Serializable {

	// Fields

	private Integer rdId;
	private Product product;
	private User user;
	private Integer currentTime;
	private Integer remainTime;

	// Constructors

	/** default constructor */
	public Research() {
	}

	/** full constructor */
	public Research(Product product, User user, Integer currentTime,
			Integer remainTime) {
		this.product = product;
		this.user = user;
		this.currentTime = currentTime;
		this.remainTime = remainTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "rdId", unique = true, nullable = false)
	public Integer getRdId() {
		return this.rdId;
	}

	public void setRdId(Integer rdId) {
		this.rdId = rdId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "productId", nullable = false)
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "currentTime", nullable = false)
	public Integer getCurrentTime() {
		return this.currentTime;
	}

	public void setCurrentTime(Integer currentTime) {
		this.currentTime = currentTime;
	}

	@Column(name = "remainTime", nullable = false)
	public Integer getRemainTime() {
		return this.remainTime;
	}

	public void setRemainTime(Integer remainTime) {
		this.remainTime = remainTime;
	}

}